//Wrapper for EE::ObjParams
#pragma once
#include "stdafx.h"

namespace EsenthelNet
{
	///<summary>Parameter Type</summary>
	public enum class ParamType {
		///<summary>Boolean</summary>
		PARAM_BOOL ,
		///<summary>Int</summary>
		PARAM_INT  ,
		///<summary>Float</summary>
		PARAM_FLT  ,
		///<summary>String</summary>
		PARAM_STR  ,
		///<summary>Enum</summary>
		PARAM_ENUM ,
		///<summary>Vector2D</summary>
		PARAM_VEC2 ,
		///<summary>Vector3D</summary>
		PARAM_VEC  ,
		///<summary>Vector4D</summary>
		PARAM_VEC4 ,
		///<summary>Color</summary>
		PARAM_COLOR,
	};

	///<summary>Parameter</summary>
	public ref struct Param {
	internal:
		Param(EE::Game::Param p) {
			param = new EE::Game::Param();
			*param = p;
		}
		Param(EE::Game::Param* p) {
			param = p;
		}

		EE::Game::Param* param;
	public:
		Param() {
			param = new EE::Game::Param();
		}
		~Param() { delete param;}

		///<summary>Parameter Type</summary>
		PropTarget(EsenthelNet::ParamType, Type, param->type, EE::Game::PARAM_TYPE)
		///<summary>Parameter Name</summary>
		PropString(Name, param->name)

		bool AsBool() { return param->asBool(); }
		int AsInt() { return param->asInt(); }
		float AsFloat() { return param->asFlt(); }
		System::String^ AsString() { return gcnew System::String(param->asStr()); }
		EsenthelNet::Vec^ AsVec() { return gcnew EsenthelNet::Vec(param->asVec()); }

		EsenthelNet::Param^ ClearValue() { param->clearValue(); return this; }
		EsenthelNet::Param^ ChangeType(EsenthelNet::ParamType type) { param->changeType((EE::Game::PARAM_TYPE)type); return this; }
	};

	///<summary>Object access mode</summary>
	public enum class ObjAccess {
		///<summary>Object can be accessed and modified during the game, this is suited for all dynamic objects</summary>
		ACCESS_DEFAULT, 
		///<summary>Object can be accessed and modified during the game, however modifications will not be saved in SaveGame, this is suited for all static  objects which require custom class</summary>
		ACCESS_CONST  , 
		///<summary>Object can't be accessed, it will be embedded into the terrain and rendered as static mesh, this is suited for all static  objects which don't require custom class</summary>
		ACCESS_EMBED  , 
		///<summary>Works like ACCESS_EMBED however it is optimized for instanced grass rendering, additionaly objects of this mode can be controlled by D.grass methods</summary>
		ACCESS_GRASS  , 
	};

	///<summary>Object Parameters - they're created in World Editor, they're used for creating typical Game Objects</summary>
	public ref class ObjParams{
	internal:
		ObjParams(EE::Game::ObjParams* p) {
			params = p;
		}

		EE::Game::ObjParams* params;
	public:
		ObjParams() {
			params = new EE::Game::ObjParams();
		}
		~ObjParams() { delete params;}

		//ToDo...

	};
}
